﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>公告查看</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet">
    <script src="/Scripts/jquery-1.11.2.min.js"></script>
    <link href="/CSS/Base/BaseClass.css?cssver=4" rel="stylesheet" type="text/css" />
    <script src="/Scripts/avalon.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <style>
        img {
            height: auto;
            width: auto\9;
            width: 100%;
        }
    </style>
    <script>
        var strId = ComFunJS.getQueryString("ID");
        var model = avalon.define({
            $id: "APP_GZRZ_View",
            modelData: {},
            plData: {},
            confirmData: {},
            PLContent: "",
            FileList:[],
            AddPL: function () {
                if ($.trim(model.PLContent) == "") {
                    parent.ComFunJS.winwarning("请输入批注内容");
                    return;
                }
                $.post('/API/FTAPI.ashx?Action=ADDCOMENT', { "P1": model.PLContent, "MsgType": "GZRZ", "MsgLYID":model. modelData.ID }, function (result) {
                    var result = $.parseJSON(result);
                    if (result.ErrorMsg == "") {
                        model.plData.push(result.Result)
                        model.PLContent = "";
                        $('#PLDiv').scrollTop($('#PLDiv')[0].scrollHeight);
                    }
                })
            },
            jptj: function (event) {
                if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10)) {
                    model.AddPL();
                }
            },

        });
        avalon.ready(function () {
            if (strId != null) {
                $.getJSON('/API/FTAPI.ashx?Action=GETGZRZMODEL', { P1: strId }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        model.modelData = resultData.Result;
                        model.plData = resultData.Result1;
                        model.FileList = resultData.Result2;
                       
                    }
                })
            }
          
        })
       
    </script>
</head>
<body ms-controller="APP_GZRZ_View">
    <div class="container-fluid" id="dvContent" style="padding:0;margin:0;">
        <div class="row" style="padding:0;margin:0">
            <div class="col-xs-12" style="padding:0">
                <div class="panel panel-default" style="border-bottom:0">
                    <div class="panel-heading">
                        <h3 style="margin:0" class="text-center"> {{modelData.LeiBie}}</h3>
                        <h5 style="margin:0" class="text-right">  添加人： {{ComFunJS.convertuser(modelData.CRUser)}} ({{modelData.RBDate|date("yyyy-MM-dd")}})</h5>
                    </div>
                    <div class="panel-body">
                        <blockquote>
                            <p ms-html="modelData.RBContent"></p>
                            <footer>日报内容 </footer>
                            <p ms-html="modelData.RBWCQK" ms-if="modelData.RBWCQK!=''"></p>
                            <footer ms-if="modelData.RBWCQK!=''">完成情况 </footer>
                        </blockquote>
                        <label ms-if="FileList.length>0">附件：</label><a style="margin-left:10px" ms-repeat-files="FileList" target="_blank" download="filename" ms-attr-href="'/View/Common/DownLoadFile.aspx?MD5='+files.FileMD5">{{files.Name+'.'+files.FileExtendName}}</a>
                    </div>
                    <div class="panel-footer" style="overflow: hidden;min-height:400px;background-color:#F3F6F8">
                        <ul class="nav nav-tabs" role="tablist">
                            <li role="presentation" class="active"><a href="#PLDiv" aria-controls="home" role="tab" data-toggle="tab">讨论区</a></li>
                        </ul>
                        <div class="tab-content">
                            <div id="PLDiv" class="tab-pane active" style="height:260px;overflow:auto;">
                                <div class="chat-widget" style="margin-top: 10PX; margin-bottom: 10px">
                                    <ul class="list-unstyled">
                                        <li class="by-me Yan-comment" ms-repeat-item="plData">
                                            <div class="avatar" style="float: left">
                                                <img alt="" ms-attr-src="'/Upload/TX/'+item.CRUser+'.jpg'" style="width:65px;height:65px" onerror="javascript: this.src = '/images/TX/default.png'">
                                            </div>
                                            <div class="chat-content">
                                                <div class="chat-meta">{{item.CRUserName}} <span style="float: right"><!--ms-if-->{{item.CRDate|date("MM月dd日 HH:mm")}}</span></div>
                                                {{item.MSGContent}}
                                                <div class="clearfix"></div>
                                            </div>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <table class="table navbar-fixed-bottom">
            <tbody>
                <tr>
                    <td class="text-center">
                        <div class="input-group">
                            <input type="text" class="form-control" ms-duplex="PLContent" ms-keypress="jptj(event)" style="height:80px" placeholder="此处输入讨论内容">
                            <span class="input-group-btn">
                                <button class="btn btn-info" style="height:80px" type="button" ms-on-click="AddPL()">添加批注</button>
                            </span>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.min.js"></script>
</body>
</html>